// import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { fetchRequest, postRequest, md5 } from './utils/http'

const app = createApp(App)

// 全局挂载HTTP方法
app.config.globalProperties.$fetch = fetchRequest
app.config.globalProperties.$post = postRequest
app.config.globalProperties.$md5 = md5
app.config.globalProperties.$baseurl = '/'

app.use(createPinia())
app.use(router)

app.use(ElementPlus)
app.mount('#app')
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
